package list;

import org.junit.Test;

public class ListTest {
	@Test
	public void testArrayList() throws Exception {
		List<Integer> list = new ArrayList<>();
		for (int i = 0; i < 20; i++) {
			list.add((int)(Math.random() * 100));
		}
		System.out.println(list);
		list.add(1, 30);
		System.out.println(list);
		list.add(0, 1);
		System.out.println(list);
		list.remove(0);
		System.out.println(list);
		list.remove(list.size() - 1);
		System.out.println(list);
		System.out.println(list.indexOf(94));
	}
}
